package jge;





public class Timer extends Time {

    private int timeAsInt;
    
    private int timeAtStart;
   
   public Timer() {
       super();
       timeAsInt = (super.getMins() * 60 * 1000) + (super.getSecs() * 1000) + (super.getMili());
       timeAtStart = (super.getMins() * 60 * 1000) + (super.getSecs() * 1000) + (super.getMili());
   }
   
   public void Update() {
       super.update();
       timeAsInt = (super.getMins() * 60 * 1000) + (super.getSecs() * 1000) + (super.getMili());
   }
   
   public int getStartTime() {
       return timeAtStart;
   }
   
   public double getDeltaTime() {
       Update();
       return (double) timeAsInt - timeAtStart;
   }
   
   public void reset() {
       super.update();
       timeAsInt = (super.getMins() * 60 * 1000) + (super.getSecs() * 1000) + (super.getMili());
       timeAtStart = (super.getMins() * 60 * 1000) + (super.getSecs() * 1000) + (super.getMili());
       
   }
   
   public int getTime() {
       Update();
       return timeAsInt;
   }
   
}